package com.jx.gocomtask.webservice.repository;

//import com.jx.gocomtask.webservice.entity.ExtTaskMessageHistory;
import java.util.List;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

import com.jx.gocomtask.webservice.entity.ExtTaskMessage;

public interface ExtTaskMessageRepository extends PagingAndSortingRepository<ExtTaskMessage,Long>,
		JpaSpecificationExecutor<ExtTaskMessage> {
	public ExtTaskMessage findByUuid(String uuid);
	//查询可建立子任务的父任务 //TaskStatus.OVER.ordinal())
	@Query(value = "select e from ExtTaskMessage e where e.isRepeat!=0  AND e.status<4")
	public List<ExtTaskMessage> pRepeatSchedlue();
	@Query(value = "select e.id from ext_task_message e where e.uuid = ?1 ", nativeQuery = true)
	public Long findUUID(String uuid);

	@Modifying
	@Query(value = "update ext_task_message e set e.status = ?2 where e.id = ?1 ", nativeQuery = true)
	public void updateById(Long id, int status); 
	
}
